<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TPHONE手机论坛-个人信息页</title>
</head>
<link href="../css/css.css" rel="stylesheet">
<link rel="stylesheet" href="../css/style1.css" media="screen" type="text/css" />

<style>
	.button {
    	background-color: #FF7701; /* Green */
    	border: none;
    	color: white;
    	padding: 10px 15px;
    	text-align: center;
    	text-decoration: none;
    	display: inline-block;
    	font-size: 15px;
    	margin: 10px 10px;
    	cursor: pointer;
    	border-radius:8px;
    	-webkit-transition-duration: 0.4s; /* Safari */
    	transition-duration: 0.4s;
}
	.button1
	{
		background-color: #FF7701; 
	}

	.button1:hover
	{
		border-radius:8px;
		cursor: pointer;
		background-color: #008CBA; 
	}
</style>
<body bgcolor="#F7F7F7">
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
<div class="Body">
	<div class="Body_logo">
    <a href="../index.html"><img src="../img/logo.png"></a>
    </div>
    <div class="Body_Serach">
    	<div style="border:0px solid red;margin:32px auto;text-align:center;">
    	<input type="text" style="height:25px;width:200px;font-family:bahnschrift;float:none;margin:1px;border-radius:10px;border-color:#FF7F00;">
        <input type="button" name="serach" style="font-size:20px;font-family:bahnschrift;position:relative;top:2px;border-radius:10px;background-color:#FF7F00;box-shadow:2px 2px 2px #FF7F00;"  value="Search">
        </div>
    </div>
    <div style="border:0px solid red;width:150px;height:100px;float:left;">
    		<span style="font-size:12px;">荣誉奖项：<br>
            <a href="https://www.mi.com" target="_blank">全网最热门网站</a><br>
            <a href="https://www.rom.com" target="_blank">安卓开源联盟网站成员</a><br>
            <a href="https://www.rom.com" target="_blank">B&A开发大奖第一名</a><br>
            <br>
            </span>
    </div>
     <div style="border:0px solid red;width:60px;height:100px;float:left;" id="controlpanel">
    		
    </div>
    <div style="border:0px solid red;width:100%;height:42px;float:left;">
      <div id="nav">
    		<ul id="Loginfo">
      			<li><a href="index.html" title="首页">首页</a></li>
      			<li><a href="phonelist.html" title="机型列表">机型列表</a></li>
      			<li><a href="usergroup.html" title="申请用户组">申请用户组</a></li>
      			<li><a href="newslist.html" title="玩机心得">玩机心得</a></li>
     	 		<li><a href="information.html" title="信息管家(原安全中心)">信息管家</a></li>
      			<li><a href="port.html" title="反馈吐槽">反馈吐槽</a></li>
      			<li style="float:right;"><a href="#" title="广告"><img alt="广告" src="../img/ad.gif" height="20"></a></li>
      			<li style="float:right;"><a href="#" title="广告2"><img alt="广告2" src="../img/ad2.gif" height="20"></a></li>
    		</ul>
  	  </div>
</div>
<div style="border:0px solid red;width:100%;height:300px;float:left;border-radius:8px;">
	<div style="border:0px solid red;width:30%;height:300px;float:left;border-radius:8px;">
	<nav>
  		<ul>
    		<li class="store">
    			<img alt="" src="../img/个人信息 (1).png" width="50" style="postion:relative;left:55px;"><b><a href="javascript:void(0)" id="basicInfo">基本信息</a></b>
    		</li>
    		<li class="movies">
    			<img alt="" src="../img/safe.png" width="50" style="postion:relative;left:55px;"><b><a href="javascript:void(0)" id="account_safe">账号安全</a></b>
    		</li>
    		<li class="music">
     			<img alt="" src="../img/实名认证.png" width="50" style="postion:relative;left:55px;"><b><a href="javascript:void(0)" id="certification">实名认证</a></b>
     		</li>
  		</ul>
	</nav>
	</div>
	<div style="border:0px solid red;width:69.616%;height:300px;float:left;border-radius:8px;" id="show">
			
	</div>
</div>
<div style="border:0px solid red;width:1030px;height:10px;float:left;">
</div>
<div style="border:0px solid red;width:1030px;height:20px;float:left;">
</div>
<div style="border:0px solid red;width:1030px;height:20px;float:left;">
</div>  
<div style="width:1030px;height:23px;border:0px solid red;float:left;">
</div>
<div style="border:0px solid red;width:1030px;height:122px;float:left;">
<div style="font-size:13px;text-align:center;"><a href="#">关于本站</a>&nbsp;|&nbsp;<a href="#">服务协议</a>&nbsp;|&nbsp;<a href="#">隐私政策</a>&nbsp;|&nbsp;<a href="#">开放平台</a>&nbsp;|&nbsp;<a href="#">商务洽谈</a>&nbsp;|&nbsp;<a href="#">安卓开源许可证</a>&nbsp;|&nbsp;<a href="#">版权所有</a>&nbsp;<br>
&copy;2019 AndroidPhoneBBS&nbsp;安卓手机刷机论坛&reg;<br>
<a href="#">粤网文[2017]6138-1456号</a> <a href="#">新出网证（粤）字010号</a> <a href="#">网络视听许可证1904073号</a> 增值电信业务经营许可证：<a href="#">粤B2-20090059 </a><a href="#">B2-20090028</a><br>
<br>
<img src="../img/备案.png">
&nbsp;<img src="../img/举报.png">
&nbsp;<img src="../img/文明.png">
&nbsp;<img src="../img/验证.png">
&nbsp;<img src="../img/网监.png">
</div>
</div>
<script src="../js/main.js" type="text/javascript"></script>
</div>
</body>
<script type="text/javascript">
$(function(){
	$.ajax({
		url:'../logins',
		method:'post',
		success:function(results){
			//alert(results);
			if(results == null){
				$('#controlpanel').append(
						'<span style="font-size:12.5px;text-align:center;"><a href="../page/Register.html">注册账户</a><br>'+
			            '</span>'+
			            '<span style="font-size:12.5px;text-align:center;"><a href="../page/Login.html">登录账户</a><br>'+
			            '</span>'
					);
			}else{
				$('#controlpanel').css("display","none");
				$('#Loginfo').append(
						'<li><a href="../page/information.html" id="act">'+results.u_account+'</a></li>'+
						'<li><a href="../logout" >'+"退出"+'</a></li>'+
						'<input id="aid" type="hidden" value="'+results.u_uid+'"/>'
				)
			}
	}
});
	
	$('#certification').on('click',function(){
		if($('#aid').val() == null){
			alert("你还未登录，请先去登录哦！");
			window.location = "Login.html";
		}else{
			$.ajax({
				url:'../get_idcard?uid='+$('#aid').val(),
				method:'get',
				success:function(result){
					if(result.u_name == null){
						$('#show').empty();
						$('#show').append(
							'<div style="border:0px solid red;width:100%;height:30px;border-radius:8px;">'+
							'<h3 align="center">你的实名认证为：未实名</h3>'+
								'<span style="position:relative;left:200px;top:0px;font-size:25px;">请输入姓名进行实名认证：<br/>'+
									'<input type="text" id="name" style="width:300px;height:30px;font-size:20px;text-align:center;"/>'+
								'</span>'+
								'<span style="position:relative;right:105px;top:40px;font-size:25px;">请输入证件号码进行实名认证：<br/>'+
									'<input type="text" id="cardnumber" style="position:relative;left:305px;bottom:10px;width:300px;height:30px;font-size:20px;text-align:center;"/>'+
								'</span>'+
								'<span style="position:relative;right:5px;top:100px;font-size:25px;"><button class="button button1" id="go">立	即		验		证</button></span>'+
							'</div>'
						)
						
						$('#go').on('click',function(){
							$.ajax({
								url:'../add_certifiation?name='+$('#name').val()+'&cardnumber='+$('#cardnumber').val()+'&uid='+$('#aid').val(),
								method:'get',
								success:function(result){
									alert(result);
									$('#show').empty();
								}
							})
						})
						
					}else{
						$('#show').empty();
						$('#show').append(
							'<div style="border:0px solid red;width:100%;height:30px;border-radius:8px;">'+
							'<h3 align="center">你的实名认证为：已实名</h3>'+
								'<span style="position:relative;left:250px;bottom:10px;font-size:25px;">你的实名信息如下：<br/>'+
									'<span style="position:relative;right:80px;top:3px;font-size:25px;">姓名：'+
										'<input type="text" id="name" value="'+result.u_name+'" readonly style="width:300px;height:30px;font-size:20px;text-align:center;"/>'+
									'</span><br/>'+
									'<span style="position:relative;right:130px;font-size:25px;">证件号码：'+
										'<input type="text" id="cardnumber" value="'+result.u_idcard+'" readonly style="position:relative;left:0px;width:300px;height:30px;font-size:20px;text-align:center;"/>'+
									'</span>'+
								'</span>'+
								'<span style="position:relative;right:155px;top:50px;font-size:25px;"><button class="button button1" id="ok" disabled="disabled">立		即		验		证</button></span>'+
							'</div>'
						)
					}
					
				}
			})
		}
		
		
	})
	
	
	var clicknum = 0;
	$('#account_safe').on('click',function(){
		$("#show").empty();
		$('#show').append(
				'<div style="border:0px solid red;width:100%;height:300px;float:left;border-radius:8px;">'+
					'<button class="button button1" id="findpwd">找回密码</button>'+
					'<button class="button button1" id="updatepwd">修改密码</button>'+
				'</div>'		
		)
		$('#updatepwd').on('click',function(){
			$('#show').empty();
			$('#show').append(
					'<div style="border:0px solid red;width:100%;height:30px;border-radius:8px;">'+
						'<span style="position:relative;left:220px;top:80px;font-size:25px;">请输入需要修改密码的账号：<br/>'+
							'<input type="text" id="account" style="width:300px;height:30px;font-size:20px;text-align:center;"/>'+
						'</span>'+
						'<span style="position:relative;right:5px;top:140px;font-size:25px;"><button class="button button1" id="upok">修 改 密 码</button></span>'+
					'</div>'		
				)
		})
		$('#findpwd').on('click',function(){
			$('#show').empty();
			$('#show').append(
					'<div style="border:0px solid red;width:100%;height:30px;border-radius:8px;">'+
						'<span style="position:relative;left:220px;top:80px;font-size:25px;">请输入需要找回密码的账号：<br/>'+
							'<input type="text" id="account" style="width:300px;height:30px;font-size:20px;text-align:center;"/>'+
						'</span>'+
						'<span style="position:relative;right:5px;top:140px;font-size:25px;"><button class="button button1" id="getpwd">找 回 密 码</button></span>'+
					'</div>'		
				)
			$('#getpwd').on('click',function(){
				if($('#account').val() == ""){
					alert("请输入需要找回密码的邮箱！");
				}else{
					$.ajax({
						url:'../getmailbox?aid='+$('#account').val(),
						method:'get',
						success:function(result){
							//alert(result);
							$('#show').empty();
							$('#show').append(
								'<div style="border:0px solid red;width:100%;height:30px;border-radius:8px;">'+
								'<h3 align="center">你的密保邮箱为：'+result+'</h3>'+
									'<span style="position:relative;left:200px;top:30px;font-size:25px;">请输入一遍完整的邮箱进行验证：<br/>'+
										'<input type="text" id="mail" style="width:300px;height:30px;font-size:20px;text-align:center;"/>'+
									'</span>'+
									'<span style="position:relative;right:5px;top:100px;font-size:25px;"><button class="button button1" id="ok">立	即		验		证</button></span>'+
								'</div>'
							)
							
							$('#ok').on('click',function(){
								if($('#mail').val() == ""){
									alert("请验证密保邮箱再进行找回密码！");
								}else{
									$.ajax({
										url:'../checkmail?mail='+$('#mail').val(),
										method:'get',
										success:function(result){
											alert(result);
											clicknum += 1;
											$('#show').empty();
											if(clicknum > 3){
												alert("不可频繁找回密码操作！");
												clicknum = 0;
												window.location = "index.html";
											}
										}
									})
								}
							})
						}
					})
				}
				
			})
				
			})
			
		})
	
	$('#basicInfo').on('click',function(){
		$.ajax({
			//alert(results.u_uid);
			url:'../get_user_info?uid='+$('#aid').val(),
			method:'get',
			success:function(result){
				if($('#aid').val() == null){
					alert("你还未登录，请先去登录哦！");
					window.location = "Login.html";
				}else if(result == null){
					//alert("你暂未完善信息，请先完善信息！");
					$("#show").empty();
					$('#show').append(
							'<div style="border:0px solid red;width:100%;height:300px;float:left;border-radius:8px;">'+
							'<span><img src="../img/face.png" style="border:0px solid red;width:220px"></span>'+
								'<div style="margin-right:12px;">'+
									'<button class="button button1" id="addinfo">更新信息</button>'+
								'</div>'+
								'<div style="border:0px solid red;position:relative;left:226px;bottom:285px;width:68%;height:296px;border-radius:8px;">'+
									'<div style="margin-left:20px">'+
										'<h4>昵称：<input style="width:300px;height:30px;font-size:20px;text-align:center;" type="text" id="nick"/></h4>'+
										'<h4>出生日期：<input style="width:268px;height:30px;font-size:20px;text-align:center;" type="date" id="birthday"/></h4>'+
									'</div>'+
									'<div style="margin-left:20px;position:relative;bottom:13px;">'+
										'<h4>性别：<input style="width:50px;height:30px;font-size:20px;text-align:center;" type="radio" name="sex" id="sex" value="男"/>男&nbsp;<input style="width:50px;height:30px;font-size:20px;text-align:center;" type="radio" name="sex"  id="sex" value="女"/>女</h4>'+
										'<h4>兴趣爱好：<input style="width:268px;height:30px;font-size:20px;text-align:center;" type="text" id="dev"/></h4>'+
									'</div>'+
								'</div>'+
						'</div>'
						)
						
						$('#addinfo').on('click',function(){
							var chkRadio = $('input:radio[name="sex"]:checked').val();
							//alert(chkRadio);
							$.ajax({
								url:'../check_user?uid='+$('#aid').val()+'&nick='+$('#nick').val()+'&birthday='+$('#birthday').val()+'&sex='+chkRadio+'&dev='+$('#dev').val(),
								method:'get',
								success:function(result){
									alert(result);
									$("#show").empty();
								}
							})
							
						})
						
				}else{
					$("#show").empty();
					var group = result.u_codename == 80 ? '普通用户组' : '特殊用户组';
					var state = result.u_state == 0 ? '停用' : '正常';
					$('#show').append(
							'<div style="border:0px solid red;width:100%;height:300px;float:left;border-radius:8px;">'+
							'<span><img src="../img/'+result.u_pic+'" style="border:0px solid red;width:220px"></span>'+
								'<div style="margin-right:12px;">'+
									'<button class="button button1">修改信息</button>'+
									'<button class="button button1" id="updateinfo">更新信息</button>'+
								'</div>'+
								'<div style="border:0px solid red;position:relative;left:226px;bottom:285px;width:68%;height:296px;border-radius:8px;">'+
									'<div style="margin-left:20px">'+
										'<h4>账号：'+result.u_account+'</h4>'+
										'<h4>昵称：'+result.u_nick+'</h4>'+
										'<h4>积分：'+result.u_points+'</h4>'+
										'<h4>注册时间：'+result.u_regtime+'</h4>'+
										'<h4>出生日期：'+result.u_birthday+'</h4>'+
										'<h4>所在用户组：'+group+'</h4>'+
									'</div>'+
									'<div style="margin-left:220px;position:relative;bottom:253px;">'+
										'<h4>性别：'+result.u_sex+'</h4>'+
										'<h4>兴趣爱好：'+result.u_dev+'</h4>'+
										'<h4>账号状态：'+state+'</h4>'+
										'<h4>电子邮箱：'+result.u_email+'</h4>'+
										'<h4>最后一次登录IP：'+result.u_ip+'</h4>'+
									'</div>'+
								'</div>'+
						'</div>'
						)
				}
				}
			})
			$('#updateinfo').on('click',function(){
				window.location.reload();
			})
	})
	
	

	})
</script>
</html>